Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: session replay respect feature flag variants #209

Merged
merged 13 commits into from
Oct 14, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Oct 10, 2024

💡 Motivation and Context

JS PR PostHog/posthog-js#1040

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto
Copy link
Member Author

@pauldambra would you mind taking a look? since I will need to implement this across SDKs

@@ -49,6 +49,32 @@ class PostHogFeatureFlags {
}
}

private func isRecordingActive(_ featureFlags: [String: Any], _ sessionRecording: [String: Any]) -> Bool {
var recordingActive = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default is active since the sessionRecording is a Map and not a boolean unless I find the linkedFlag and can compare things

Comment on lines +144 to +145
for item in samplesByTask where item.key.state == .completed {
completedTasks[item.key] = item.value
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just fixing a lint issue

@marandaneto marandaneto requested a review from ioannisj October 10, 2024 16:00
@@ -120,15 +120,20 @@ class PostHogStorage {
}

/**
There are cases where applications using posthog-ios want to share analytics data between host app and an app extension, Widget or App Clip. If there's a defined `appGroupIdentifier` in configuration, we want to use a shared container for storing data so that extensions correcly identify a user (and batch process events)
There are cases where applications using posthog-ios want to share analytics data between host app and
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just fixed a lint issue (line_length)

@marandaneto marandaneto requested a review from a team October 11, 2024 13:12
@marandaneto marandaneto marked this pull request as ready for review October 11, 2024 13:13
@marandaneto
Copy link
Member Author

@ioannisj @pauldambra done, please double check after changes, I will do Android next (Monday)

{
recordingActive = value == variant
}
// check for multi flag variant (any)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clean up these comments here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so since it's a valid result from the API and might help while debugging things

@marandaneto marandaneto merged commit 0fe478a into main Oct 14, 2024
10 checks passed
@marandaneto marandaneto deleted the fix/replay-feature-flag branch October 14, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants